package mysql

import "gorm.io/gorm"

// 用户表
type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(20);not null"`
	Password string `gorm:"type:char(32);not null"`
	Image    string `gorm:"type:varchar(500);not null"`
	Name     string `gorm:"type:varchar(20);not null"`
}

// 小说表
type Novel struct {
	gorm.Model
	Name   string `gorm:"type:varchar(20);not null"`
	Types  string `gorm:"type:varchar(20);not null"`
	Tile   string `gorm:"type:varchar(20);not null"`
	Ifor   string `gorm:"type:varchar(500);not null"`
	UserId int
}

// 评价表
type Course struct {
	gorm.Model
	UserId  int
	NovelId int
	Ifor    string `gorm:"type:varchar(500);not null"`
}

// 书架表
type Bookshelf struct {
	gorm.Model
	UserId  int
	NovelId int
}

type NovelUser struct {
	Novel
	UserName string
}

type BookshelfData struct {
	UserName  string
	NovelName string
	Bookshelf
}
type CourseData struct {
	NovelName string
	Course
}
